package org.mspring.platform.security.dao.impl;

import java.util.List;

import org.mspring.platform.dao.hibernate.GenericDao;
import org.mspring.platform.security.dao.ResourceDao;
import org.mspring.platform.security.entity.Resource;
import org.springframework.stereotype.Repository;

/**
 *
 * @author Gao Youbo
 * @since 2014-01-11
 */
@Repository
public class ResourceDaoImpl extends GenericDao<Resource, Long> implements ResourceDao {

    @Override
    public List<Resource> listByRole(Long roleId) {
        return list("select roleResource.PK.resource from RoleResource roleResource where roleResource.PK.role.id = ?", roleId);
    }

}
